/**CopyRight[1990-2012]<lyc2877@gmail.com>
 */
#include "./include/Sender.h"
CSender::CSender(int64_t in_lType) {
  m_pMQueue = new CMQueue(in_lType);
}

CSender::~CSender() {
  if (NULL != m_pMQueue) {
    delete m_pMQueue;
  }
}

int32_t CSender::work() {
  TMsg t_msg;
  memset(&t_msg, '\0', sizeof(TMsg));
  t_msg.m_lTo = MQKEY_WORKER;
  int count = 0;
  while(1) {
    ++count;
    m_pMQueue->send_msg(&t_msg);
    if (0 == count % 10000) {
      printf("send count[%d]\n", count);
      usleep(500000);
    }
  }
  return 0;
}
